#ifndef CAMERA_H
#define CAMERA_H

#include "d3dUtil.h"

// Simple camera class that lets the viewer explore the 3D scene.
//   -It keeps track of the camera coordinate system relative to the world space
//    so that the view matrix can be obtained.  
//   -It keeps track of the viewing frustum of the camera so that the projection
//    matrix can be obtained.
class Camera
{
public:
	Camera();
	~Camera();

	XMFLOAT3& position();

	XMFLOAT4X4 view()const;
	XMFLOAT4X4 proj()const;

	void setLens(float fovY, float aspect, float zn, float zf);

	void strafe(float d);
	void walk(float d);

	void pitch(float angle);
	void rotateY(float angle);

	void rebuildView();
	void rebuildViewOld();

private:
	XMFLOAT3 mPosition;
	XMFLOAT3 mRight;
	XMFLOAT3 mUp;
	XMFLOAT3 mLook;

	XMFLOAT4X4 mView;
	XMFLOAT4X4 mProj;
};

Camera& GetCamera();

#endif // DEMO_CAMERA_H